package com.hxy.springcloud.service.impl;

import com.hxy.springcloud.dao.DepartmentDao;
import com.hxy.springcloud.pojo.Department;
import com.hxy.springcloud.service.DepartnentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartnentServiceImpl implements DepartnentService {

    @Autowired
    private DepartmentDao departmentDao;

    @Override
    public boolean addDepartment(Department department) {
        return departmentDao.addDepartment(department);
    }

    @Override
    public Department queryDepartmentById(long id) {
        return departmentDao.queryDepartmentById(id);
    }

    @Override
    public List<Department> queryAllDepartment() {
        List<Department> list = departmentDao.queryAllDepartment();
        return list;
    }
}
